package com.example.activitytest1;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;

public class SecondActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        Log.d("SecondActivity","Task id is"+getTaskId());
        Log.d("SecondActivity",this.toString());
        setContentView(R.layout.second_layout);
        Button button2=(Button)findViewById(R.id.button2);
        button2.setOnClickListener(new View.OnClickListener()
        {
            @Override
            public void onClick(View v){
                Intent intent=new Intent(SecondActivity.this, ThirdActivity.class);
                startActivity(intent);
            }
        });
    }

    @Override
    protected void onRestart()
    {
        super.onRestart();
        Log.d("SecondActivity","onRestart");
    }
    @Override
    protected void onStart()
    {
        super.onStart();
        Log.d("SecondActivity","onStart");
    }

    @Override
    protected void onResume()
    {
        super.onResume();
        Log.d("SecondActivity","onResume");
        Log.d("SecondActivity","Task id is"+getTaskId());
        Log.d("SecondActivity",this.toString());
    }
}
